from rest_framework_jwt.settings import api_settings


def generate_jwt_token(user):
    payload_handler = api_settings.JWT_PAYLOAD_HANDLER
    encode_handler = api_settings.JWT_ENCODE_HANDLER

    payload = payload_handler(user)
    token = encode_handler(payload)
    return token
